home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
restaurante_1072.swf
/
scripts
/
__Packages
/
Table.as
< prev
next >
Wrap
Text File
|
2009-04-16
|
24KB
|
580 lines
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(!_global.Table)
{
_global.Table extends MissionItem;
var _loc2_ = _global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.prototype;
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.getTableByIJ = function(ii, jj)
{
var _loc2_ = Mission.getMission().__get__tables();
var _loc1_ = 0;
while(_loc1_ < _loc2_.length)
{
if(_loc2_[_loc1_].RowNum.i == ii && _loc2_[_loc1_].RowNum.j == jj)
{
return _loc2_[_loc1_];
}
_loc1_ = _loc1_ + 1;
}
return _loc2_[0];
};
_loc2_.__get__food = function()
{
return this._food;
};
_loc2_.__get__maxNumCustomers = function()
{
return 2;
};
_loc2_.__get__deskMc = function()
{
return this.desk;
};
_loc2_.__get__customerLeave = function()
{
return this._coustomerLeave;
};
_loc2_.__get__rendezvousPoint = function()
{
return {x:this.__get__mc()._x,y:this.__get__mc()._y - 51};
};
_loc2_.__get__leftPoint = function()
{
return {x:this.__get__mc()._x - 50,y:this.__get__mc()._y - 25};
};
_loc2_.__get__isHappy = function()
{
if(this.customers.length < 2)
{
return false;
}
var _loc2_ = 0;
while(_loc2_ < this.customers.length)
{
if(this.customers[_loc2_].numHearts < 5)
{
return false;
}
_loc2_ = _loc2_ + 1;
}
return true;
};
_loc2_.__get__isEmpty = function()
{
return this.customers.length <= 0;
};
_loc2_.__get__customersArray = function()
{
return this.customers;
};
_loc2_.__get__isNotFull = function()
{
return this.__get__status() == Table.NOTFULL;
};
_loc2_.__get__isLove = function()
{
return this._isLove;
};
_loc2_.__get__rightPoint = function()
{
return {x:this.__get__mc()._x + 50,y:this.__get__mc()._y - 25};
};
_loc2_.__get__arrivePoint = function()
{
return {x:this.__get__mc()._x,y:this.__get__mc()._y - 1};
};
_loc2_.__get__RowNum = function()
{
return this.row_num;
};
_loc2_.__get__numCustomers = function()
{
return this.customers.length;
};
_loc2_.__get__cashes = function()
{
return this.cash;
};
_loc2_.addCustomer = function(c)
{
var obj = this;
this.customers.push(c);
c.__get__mc().removeMovieClip();
Mission.getMission().__get__door().reduceCustomer(c);
c.__set__status(Customer.SIT);
c.__set__mc(this.__get__mc().attachMovie(CustomerType.__get__TYPES()[c.__get__type()],"customerMc" + this.__get__numCustomers(),this.__get__mc().getNextHighestDepth()));
if(this.__get__numCustomers() == 1)
{
c.setDirection(Direction.RIGHT);
}
else if(this.__get__numCustomers() == 2)
{
c.setDirection(Direction.LEFT);
CustomerType.createCouple(this.customers[0],this.customers[1]);
var interval = setInterval(function()
{
if(!obj.__get__isEmpty() && !obj.__get__customerLeave())
{
obj.__set__status(Table.MENU);
}
clearInterval(interval);
}
,this.menuDelay);
}
this.desk.swapDepths(this.__get__mc().getNextHighestDepth());
c.__get__mc()._x = this.chairs[this.__get__numCustomers() - 1]._x;
c.__get__mc()._y = this.chairs[this.__get__numCustomers() - 1]._y;
};
_loc2_.getFood = function($food)
{
this._food = $food;
this.__set__status(Table.EATING);
this.__get__food().__set__mc(this.desk.attachMovie(MissionData.DATA[Mission.getMission().__get__id()].food.linkName,"food",this.desk.getNextHighestDepth()));
};
_loc2_.listenMusic = function()
{
var obj = this;
this.musicInterval = setInterval(function()
{
var _loc1_ = 0;
while(_loc1_ < obj.customers.length)
{
Customer(obj.customers[_loc1_]).changeHearts(1);
_loc1_ = _loc1_ + 1;
}
}
,this.musicDelay);
};
_loc2_.musicStop = function()
{
var _loc2_ = this;
clearInterval(this.musicInterval);
};
_loc2_.onRollOver = function()
{
this.__get__mc()._alpha = 50;
};
_loc2_.onRollOut = function()
{
this.__get__mc()._alpha = 100;
};
_loc2_.customersLeave = function(c)
{
var obj = this;
Mission.getMission().__get__kitchen().tableCustomerAngry(obj);
var _loc2_ = 0;
while(_loc2_ < obj.customers.length)
{
if(obj.customers[_loc2_] != c)
{
Customer(obj.customers[_loc2_]).leave(true);
}
_loc2_ = _loc2_ + 1;
}
var love = obj.desk.attachMovie("Fire","fire" + getTimer(),obj.desk.getNextHighestDepth(),{_y:10});
var _loc6_ = Customer(obj.customers[0]);
var _loc5_ = Customer(obj.customers[1]);
var _loc8_ = CustomerType.__get__KISSDEPTHS()[_loc6_.__get__type()];
var _loc4_ = CustomerType.__get__KISSDEPTHS()[_loc5_.__get__type()];
_loc4_ = _loc8_ != _loc4_ ? _loc4_ : _loc8_ + 1;
var _loc7_ = CustomerType.__get__TYPES()[_loc6_.__get__type()] + "Angry";
var _loc11_ = CustomerType.__get__TYPES()[_loc5_.__get__type()] + "Angry";
var _loc10_ = love.attachMovie(_loc7_,_loc7_ + getTimer(),_loc8_);
var _loc9_ = love.attachMovie(_loc11_,_loc7_ + getTimer(),_loc4_);
_loc10_.gotoAndStop(_loc6_.__get__directionNow());
_loc9_.gotoAndStop(_loc5_.__get__directionNow());
this._coustomerLeave = true;
var interval = setInterval(function()
{
love.removeMovieClip();
var _loc1_ = 0;
while(_loc1_ < obj.customers.length)
{
obj.customers[_loc1_].terminate();
_loc1_ = _loc1_ + 1;
}
obj.customers = [];
Mission.getMission().tableCustomersLeave(obj);
obj.__set__status(Table.NOTFULL);
clearInterval(interval);
}
,2000);
};
_loc2_.initTableData = function(data)
{
this.desk = this.__get__mc()[data.deskName];
this.chairs = [this.__get__mc()[data.chair1Name],this.__get__mc()[data.chair2Name]];
this.row_num = {i:data.i,j:data.j};
this.musicBtn = MovieClip(this.desk[data.musicName]);
};
_loc2_.notFullHandle = function()
{
this.musicBtn.onRelease = null;
this._coustomerLeave = false;
this._isLove = false;
for(var _loc2_ in this.desk)
{
if(typeof this.desk[_loc2_] == "movieclip")
{
this.desk[_loc2_].removeMovieClip();
}
}
};
_loc2_.menuHandle = function()
{
var obj = this;
var _loc2_ = this.desk.attachMovie("Menu","menu" + getTimer(),this.desk.getNextHighestDepth(),{_x:0,_y:0});
_loc2_.onRelease = function()
{
var _loc2_ = Mission.getMission().__get__waitress();
if(!_loc2_.__get__isBusy())
{
Mission.getMission().__get__waitress().menuService(obj,this);
}
};
};
_loc2_.eatingHandle = function()
{
function eatHalf()
{
obj._food.__set__status(Food.HALF);
clearInterval(interval);
}
function eatAll()
{
obj.pay();
obj.musicBtn.onRelease = null;
obj._food.__set__status(Food.EMPTY);
clearInterval(interval2);
}
var obj = this;
var _loc2_ = 0;
while(_loc2_ < obj.customers.length)
{
Customer(obj.customers[_loc2_]).stopLoseHeart();
_loc2_ = _loc2_ + 1;
}
this.musicBtn.onRelease = function()
{
if(!Mission.getMission().__get__waitress().__get__isBusy())
{
Mission.getMission().__get__waitress().musicService(obj);
}
};
var interval = setInterval(eatHalf,this.eatDelay / 2);
var interval2 = setInterval(eatAll,this.eatDelay);
};
_loc2_.pay = function()
{
function love()
{
obj._isLove = true;
var love = obj.desk.attachMovie("Love","love" + getTimer(),obj.desk.getNextHighestDepth(),{_y:10,_xscale:0,_yscale:0});
var _loc1_ = new Sound();
_loc1_.attachSound("Gita");
_loc1_.start();
var c1 = Customer(obj.customers[0]);
var c2 = Customer(obj.customers[1]);
var d1 = CustomerType.__get__KISSDEPTHS()[c1.__get__type()];
var d2 = CustomerType.__get__KISSDEPTHS()[c2.__get__type()];
d2 = d1 != d2 ? d2 : d1 + 1;
var mc1 = CustomerType.__get__TYPES()[c1.__get__type()] + "Kiss";
var mc2 = CustomerType.__get__TYPES()[c2.__get__type()] + "Kiss";
var _loc4_ = new mx.transitions.Tween(love,"_xscale",mx.transitions.easing.Elastic.easeOut,0,80,1.5,true);
var _loc5_ = new mx.transitions.Tween(love,"_yscale",mx.transitions.easing.Elastic.easeOut,0,80,1.5,true);
_loc4_.onMotionFinished = function()
{
var _loc2_ = love.attachMovie(mc1,mc1 + getTimer(),d1,{_xscale:80,_yscale:80});
var _loc1_ = love.attachMovie(mc2,mc1 + getTimer(),d2,{_xscale:80,_yscale:80});
_loc2_.gotoAndStop(c1.__get__directionNow());
_loc1_.gotoAndStop(c2.__get__directionNow());
};
var interval = setInterval(function()
{
love.removeMovieClip();
allLeave();
clearInterval(interval);
}
,3000);
}
function allLeave()
{
var _loc1_ = 0;
while(_loc1_ < obj.customers.length)
{
obj.customers[_loc1_].terminate();
_loc1_ = _loc1_ + 1;
}
obj._food.__get__mc().onRelease = function()
{
var _loc1_ = Mission.getMission().__get__waitress();
if(!_loc1_.__get__isBusy())
{
Mission.getMission().__get__waitress().cleanService(obj);
}
};
var _loc2_ = new Sound();
_loc2_.attachSound("CashSnd");
_loc2_.start();
obj.customers = [];
Mission.getMission().tableCustomersLeave(obj);
}
var obj = this;
this._coustomerLeave = true;
var _loc3_ = Customer.MAXNUMHEARTS;
var _loc2_ = 0;
while(_loc2_ < this.customers.length)
{
if(_loc3_ > Customer(this.customers[_loc2_]).__get__numHearts())
{
_loc3_ = Customer(this.customers[_loc2_]).numHearts;
}
_loc2_ = _loc2_ + 1;
}
this.cash = _loc3_ * 100;
if(_loc3_ >= Table.NUMHEARTSFORLOVE)
{
love();
}
else
{
allLeave();
}
};
_loc2_.eattedHandle = function()
{
this.__set__status(Table.NOTFULL);
};
_loc2_.toString = function()
{
return "table (" + this.__get__RowNum().i + ", " + this.__get__RowNum().j + "): " + this.__get__mc()._name;
};
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.STATUSCHANGEDEVENT = "tableStatusChangedHandle";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.NOTFULL = "notFull";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.FULL = "full";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.MENU = "menu";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.WAITFOOD = "waitFood";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.EATING = "eating";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.EATTED = "eatted";
_global.Table = function($mc, $data)
{
super($mc);
this._status = Table.NOTFULL;
this.customers = [];
this.initTableData($data);
this.__set__status(Table.NOTFULL);
var obj = this;
this.__get__mc().onMouseUp = function()
{
obj.onRollOut();
};
}.NUMHEARTSFORLOVE = 5;
_loc2_._money = 0;
_loc2_.menuDelay = 2500;
_loc2_._food = null;
_loc2_.eatDelay = 20000;
_loc2_._rendezvousPoint = null;
_loc2_._arrivePoint = null;
_loc2_.musicDelay = 3000;
_loc2_._isLove = false;
_loc2_.cash = 0;
_loc2_._coustomerLeave = false;
§§push(_loc2_.addProperty("RowNum",_loc2_.__get__RowNum,function()
{
}
));
§§push(_loc2_.addProperty("arrivePoint",_loc2_.__get__arrivePoint,function()
{
}
));
§§push(_loc2_.addProperty("cashes",_loc2_.__get__cashes,function()
{
}
));
§§push(_loc2_.addProperty("customerLeave",_loc2_.__get__customerLeave,function()
{
}
));
§§push(_loc2_.addProperty("customersArray",_loc2_.__get__customersArray,function()
{
}
));
§§push(_loc2_.addProperty("deskMc",_loc2_.__get__deskMc,function()
{
}
));
§§push(_loc2_.addProperty("food",_loc2_.__get__food,function()
{
}
));
§§push(_loc2_.addProperty("isEmpty",_loc2_.__get__isEmpty,function()
{
}
));
§§push(_loc2_.addProperty("isHappy",_loc2_.__get__isHappy,function()
{
}
));
§§push(_loc2_.addProperty("isLove",_loc2_.__get__isLove,function()
{
}
));
§§push(_loc2_.addProperty("isNotFull",_loc2_.__get__isNotFull,function()
{
}
));
§§push(_loc2_.addProperty("leftPoint",_loc2_.__get__leftPoint,function()
{
}
));
§§push(_loc2_.addProperty("maxNumCustomers",_loc2_.__get__maxNumCustomers,function()
{
}
));
§§push(_loc2_.addProperty("numCustomers",_loc2_.__get__numCustomers,function()
{
}
));
§§push(_loc2_.addProperty("rendezvousPoint",_loc2_.__get__rendezvousPoint,function()
{
}
));
§§push(_loc2_.addProperty("rightPoint",_loc2_.__get__rightPoint,function()
{
}
));
§§push(ASSetPropFlags(_global.Table.prototype,null,1));
}
§§pop();
}
}
§§goto(addr1625);
}
§§push(§§pop()[function §\x1b�\x02§(§�\x07§, §\x01§, §\x02\x01§, §\x01§, §���\x07��\x07�§, _global, Table, _status, NOTFULL, customers, initTableData, __set__status, obj, __get__mc)
{
}]);
}
addr1625: